
<div class="sidebarmenu">
<ul id="sidebarmenu1">
		  <? $result = mysql_query("select * from categories where parent_id=0 and categories_description!='' order by sort_order",$con);
while (($row=mysql_fetch_assoc($result)))
{
?>
 <li><a  href="./?frame=category&cat=<? echo $row['categories_id']; ?>&lg=1"><? echo $row['categories_description']; ?></a>
<?
	$resultsub = mysql_query("select * from categories where categories_status=0 and parent_id=".$row['categories_id']." order by sort_order",$con);
	$munucon=mysql_num_rows($resultsub);
	if($munucon >0)
	{
	?><ul>
    <?
			while (($catsub=mysql_fetch_assoc($resultsub)))
	{?>    <li>	
				<a  href="./?frame=category&cat=<? echo $catsub['categories_id']; ?>&lg=1"><? echo $catsub['categories_description']; ?></a>
				
				<?
	$resultsub3 = mysql_query("select * from categories where categories_status=0 and parent_id=".$catsub['categories_id']." order by sort_order",$con);
	$munucon3=mysql_num_rows($resultsub3);
	if($munucon3 >0)
	{
	?><ul>
    <?
			while (($catsub3=mysql_fetch_assoc($resultsub3)))
	{?>    <li>	
				<a  href="./?frame=category&cat=<? echo $catsub3['categories_id']; ?>&lg=1"> <? echo $catsub3['categories_description']; ?></a></li>
<? }?>
       </ul><? }?>
				
				
				
				
				
				
				</li>
<? }?>
       </ul><? }?>
	  </li>
<? }?></ul>

</div>